﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.Objects;
using Persistency.DAL;

namespace SharedBusinessLogic.Models
{
	public class OrganisationOverviewModel
	{
		#region Construction

		public OrganisationOverviewModel()
		{

		}

		#endregion

		#region Functions

		public List<OrganisationObject> GetOrganisations()
		{
			return GetOrganisations(0);
		}

		public List<OrganisationObject> GetOrganisations(int orgKey)
		{
			List<OrganisationObject> organisations = OrganisatonDAL.GetOrganisation(orgKey);
			foreach (OrganisationObject orgObject in organisations)
			{
				orgObject.AdressenListe = AdressDAL.GetOrganisationAdressen(orgObject.OrgKey);
				//toDo: add Personen
			}
			return organisations;
		}
		#endregion

	}
}
